import { lazy } from "react";
import { createBrowserRouter } from 'react-router-dom'
import {
    AppOutline,
    MessageOutline,
    MessageFill,
    UnorderedListOutline,
    UserOutline,
} from 'antd-mobile-icons'

const Home = lazy(() => import('../parge/Home/Home'))
const Login = lazy(() => import('../parge/Login/Login'))
const Order = lazy(() => import('../parge/Order/Order'))
const My = lazy(() => import('../parge/My/My'))
const Index = lazy(() => import('../parge/Index/Index'))
const City = lazy(() => import('../parge/City/City'))
const OrderDetail = lazy(() => import('../parge/OrderList/OrderDetail'))
const OrderList = lazy(() => import('../parge/OrderList/OrderList'))
const Day = lazy(() => import('../parge/Day/Day'))

const Todo = lazy(() => import('../parge/todo/index'))
const Message = lazy(() => import('../parge/message/search'))
const OrderL = lazy(() => import('../parge/todo/index'))
const Todo1 = lazy(() => import('../parge/todo/todo'))
const Search= lazy(() => import('../parge/message/search'))


export const routerlist = [
    {
        path: '/index',
        title: '首页',
        icon: <AppOutline />,
        element: <Index></Index>,
    },
    {
        path: '/todo',
        title: '待办',
        icon: <UnorderedListOutline />,
        element: <Todo1></Todo1>,
    },
    {
        path: '/message',
        title: '消息',
        icon: <MessageFill />,
        element: <Message></Message>,
    },
    {
        path: '/my',
        title: '我的',
        icon: <UserOutline />,
        element: <My></My>,
    },
]

const router = createBrowserRouter([
    {
        path: '/',
        element: <Home></Home>,
        children: routerlist
    },
    {
        path: '/login',
        element: <Login></Login>
    },
    {
        path: '/order',
        element: <Order></Order>
    },
    {
        path: '/city',
        element: <City></City>
    },
    {
        path: '/orderDetail',
        element: <OrderDetail></OrderDetail>
    }
    ,
    {
        path: '/orderList',
        element: <OrderList></OrderList>
    },
    {
        path: '/day',
        element: <Day></Day>
    },
    {
        path: '/orderL',
        element: <OrderL></OrderL>
    },
    {
        path: '/search',
        element: <Search></Search>
    },


])

export default router